
a = [44,38,78,37,96,4,45,69]
print('排序前数据',a)
i = 0
flag = True
while i<len(a) and flag==True:
    flag = False
    for j in range(len(a)-i-1):
        if a[j] > a[j+1]:  
            a[j] , a[j+1] = a[j+1] , a[j]
            flag = True
    i += 1

print('排序后数据',a)
print('排序加工遍数为',i-1)
